-- AI перемещения
function ai_going(v)
	if not v._goway or v._goway == deref(where(v)) then v._goway = deref(where(v))
	else
		local way
		if v._goway ~= deref(where(v)) then
			way = deepcopy(wayfind(where(v),v._goway))
			if type(way) == 'string' then
				v._goway = deref(where(v))
			else move(v,way[2],where(v))
			end
		end
	end
end